public class ArrayWithThreeConsecutiveOddNumbers {
    public static boolean solution(int[] array){
        int count=0;
        for (int i = 0; i < array.length; i++) {
            if (array[i]%2==1){
                count++;
            }else if(count<3){
                count=0;
            }
        }
        if(count>=3){
            return true;
        }
        return false;
    }
    public static void main(String[] args) {
        int[] array={1,2,34,3,4,5,7,23,12};
        System.out.println(solution(array));
    }
}
